<script setup>
import {useUserStore} from '../stores/user'
const user = useUserStore()
</script>
<template>
    <!-- 判断是否需要显示 footer -->
  <!-- <footer class='footer' v-if="!$route.meta.hidden"> -->
    <!-- 通过命名视图来决定是否显示页脚 -->
    <footer class='footer'>
    <RouterLink to='/home'>
      <!-- 用来显示图标 -->
      <span class='iconfont icon-shouye'></span>
      <!-- 显示标题 -->
      <p>首页</p>
    </RouterLink>
    <RouterLink to='/kind'>
      <span class='iconfont icon-fenlei'></span>
      <p>分类</p>
    </RouterLink>
      <RouterLink to='/cart'>
      <span class='iconfont icon-gouwuche'></span>
      <p>购物车</p>
    </RouterLink>

    <RouterLink v-if="user.loginState" to='/user'>
      <span class='iconfont icon-My'></span>
      <p>用户</p>
    </RouterLink>

    <RouterLink v-else to='/login'>
      <span class='iconfont icon-My'></span>
      <p>未登录</p>
    </RouterLink>

  </footer>
</template>